import React from "react"
import { Button } from "antd"
import { useDispatch } from "react-redux"
import { save_user_info } from "./homeSlice"

function Home(props) {
    /******** 演示代码 ********/
    const dispatch = useDispatch()
    const test_user = {
        name: "小芳",
    }
    const redux_test = () => {
        dispatch(save_user_info(test_user))
    }
    /* ************************/

    return (
        <div className="home">
            <header>欢迎来到,元宇宙社区</header>
            <h1>我是HOME123</h1>
            <Button type="primary" onClick={redux_test}>
                (演示)保存状态到redux按钮
            </Button>
        </div>
    )
}

export default Home
